﻿/**
*年假查询页
*/
Chenxin.UI.pgAnnualLeaveSearch = Chenxin.extend(Chenxin.UI.PageCommon,{
    autoInitForm:false,
    actionUrl:'/service/annualLeaveSearch.ashx',
    createGrid:function(){
      return new Chenxin.UI.Pagination({
            actionUrl:this.actionUrl + "?op=Search",
			pageSize:20,
			renderTo: 'house_table'
        });
    },
    createSearch:function(){
       return new Chenxin.UI.srhAnnualLeaveSearch({
            scope:this,
            afterGetParamJson:function(data){
                var str = data;
            }
        });
    },
    setSearchMatch:function(){
        var objPg = this;
        this.intervalId = window.setInterval(function() { $("#dlSearchMatch").hide(); objPg.clearTime() ; }, 300);
    },
    clearTime:function(){
        window.clearInterval(this.intervalId);
    },
    initEvent:function(){
        var objPg = this;
        
        /*************************事件：列表行点击事件************************/
	    $('.tr_houselist').live('click',function(){	
			$('.tr_houselist,.selected_orgbgcolor').each(function(){
				$(this).removeClass('selected_orgbgcolor');	
			});
			
			$(this).toggleClass('selected_orgbgcolor');	
			if(!$('#tr-house-info').length){
				objPg.currentId=this.id;
				
			}else{
				$('#tr-house-info').remove();
				if(objPg.currentId!=this.id){
					objPg.currentId=this.id;
				}
			}
		});
		/*************************事件：列表行鼠标滑过************************/
	    $('.tr_houselist').live('mouseover',function(){
			$(this).toggleClass('orgbgcolor');
		});
		/*************************事件：列表行鼠标离开************************/
		$('.tr_houselist').live('mouseout',function(){
			$(this).toggleClass('orgbgcolor');
		});
    }
});

/**
*查询部分
*/
Chenxin.UI.srhAnnualLeaveSearch = Chenxin.extend(Chenxin.UI.SearchCommon,{
    id:"house_search",
    initEvent:function(){
        var objSrh = this;
        /*************************事件：检索************************/
        $("#btSreachAnn").click(function(){
            objSrh.scope.reloadGrid();
        });
    },
    createComboList:function(){
		var cmbStruct = new Chenxin.UI.StructComboList();
		var cmbList = cmbStruct.comboList;
		return cmbList;
    }
});

$(document).ready(function(){
    var objPg = new Chenxin.UI.pgAnnualLeaveSearch();
});